package cn.humaohua.study.yanmo_design_pattern.ch12.v3;

import java.util.ArrayList;
import java.util.List;

public abstract class WaterQualitySubject {
    protected List<WatcherObserver> observers = new ArrayList<WatcherObserver>();

    public void attach(WatcherObserver observer) {
        observers.add(observer);
    }

    public void detach(WatcherObserver observer) {
        observers.remove(observer);
    }

    protected abstract void notifyObservers();

    protected abstract int getPolluteLevel();
}
